<template>
<div class="user">
    <div class="operation-wrap">
      <p> {{$t('plus.note_active_users_limit')}}</p>
      <p> {{$t('plus.note_abuse_warning')}}</p>
    </div>
    <el-form ref="form" :model="form" label-width="100px">
      <!--添加门店-->
      <div class="common-form">{{$t('plus.send_template_msg')}}</div>
      <el-form-item :label="$t('plus.user_id')">
        <el-input v-model="form.article_title" :placeholder="$t('plus.input_user_id')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_id')">
        <el-input v-model="form.article_title" :placeholder="$t('plus.input_template_id')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_line1')">
        <el-input v-model="form.virtual_views" :placeholder="$t('plus.input_template_line1')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_line2')">
        <el-input v-model="form.virtual_views" :placeholder="$t('plus.input_template_line2')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_line3')">
        <el-input v-model="form.virtual_views" :placeholder="$t('plus.input_template_line3')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_line4')">
        <el-input v-model="form.virtual_views" :placeholder="$t('plus.input_template_line4')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.template_line5')">
        <el-input v-model="form.virtual_views" :placeholder="$t('plus.input_template_line5')"></el-input>
      </el-form-item>
      <el-form-item :label="$t('plus.redirect_page')">
        <el-input v-model="form.virtual_views" value="pages/index/index" placeholder="pages/index/index"></el-input>
      </el-form-item>
      <!--提交-->

       <div class="common-button-wrapper">
        <el-button type="primary" @click="onSubmit">{{$t('plus.submit')}}</el-button>
      </div>

    </el-form>
  </div>
</template>

<script>
import PushApi from '@/api/push.js';
export default {
  data() {
    return {
      form: {
        status: 0
      }
    };
  },
  methods: {
    /*添加文章*/
    onSubmit() {
      let self = this;
      let params = this.form;
      PushApi.send(params, true).then(data => {
        if (data.code == 1) {
          ElMessage({
            message: $t("plus.add_success"),
            type: 'success'
          });
          self.$router.push('/plus/article/Index');
        } else {
          ElMessage.error($t("plus.error_message_sample"));
        }
      }).catch(error => {});
    }
  }
};
</script>

